
#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main() {
    int i;
    int seed = 1000;
    int numPlayer = 2;
    int r;
    int loopCount = 10;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
    int result;
    int hand = 1;
    int bonus = 0;
    int numberCards;
    
    
    
#if (NOISY_TEST == 1)
                printf ("TESTING great_hallFunction():\n"); // testing for number of cards and number of actions
                
#endif
        for(i = 0; i < loopCount; i++){
                memset(&G, 23, sizeof(struct gameState));   // clear the game state
                r = initializeGame(numPlayer, k, seed, &G); // initialize a new game

                result=cardEffect(great_hall, 0, 0, 0, &G, hand, &bonus);
                numberCards = *G.handCount;                 // set the number of cards on hand
                
#if (NOISY_TEST == 1)
                printf("Number of Cards = %d, expected = %d\n", numberCards, 2);
#endif
                assert(numberCards = 2); // check if the number of cards is correct

#if (NOISY_TEST == 1)
                printf("Number of Actions = %d, expected = %d\n", G.numActions, 2);
#endif
                assert(G.numActions == 2); // check if the number of actions is correct

                
        }
    printf("All tests passed!\n");

    return 0;
}
